home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-12-11 | 2.8 KB | 117 lines | [TEXT/MPS ] |
- /*
- File: CappuccinoUndo.cpp
-
- Contents: Implements undo/redo support.
-
- Written by: Troy Gaul
-
- Copyright: © 1995 by Apple Computer, Inc., all rights reserved.
- */
-
- // -- Compiler/Preprocessor Switches --
-
- #ifndef _COMPILERDEFS_
- #include "CompDefs.h"
- #endif
-
- // -- OpenDoc Utilities --
-
- #ifndef _EXCEPT_
- // Exceptions define several important macros (eg. CHECKENV)
- // which are used in the SOM method dispatch glue. If Except.h
- // is not included early enough, exceptions may not be thrown
- // correctly when returning from a SOM method with the "ev" parameter set.
- #include <Except.h>
- #endif
-
- // -- Cappuccino Includes --
-
- #ifndef _CAPPUCCINO_
- #include "Cappuccino.h"
- #endif
-
- #ifndef _CAPPUCCINOACTION_
- #include "CappuccinoAction.h"
- #endif
-
- #ifndef _CAPPUCCINODEF_
- #include "CappuccinoDef.h"
- #endif
-
- #ifndef _CAPPUCCINOGLOBALS_
- #include "CappuccinoGlobals.h"
- #endif
-
- // -- OpenDoc Includes --
-
- #ifndef _ODTYPES_
- #include <ODTypes.h>
- #endif
-
- // -- OpenDoc Utilities --
-
- #ifndef _ODDEBUG_
- #include <ODDebug.h>
- #endif
-
- #ifndef _ODUTILS_
- #include <ODUtils.h>
- #endif
-
- #ifndef _TEMPOBJ_
- #include <TempObj.h>
- #endif
-
- //==============================================================================
- #pragma mark • Undo ODPart overrides •
- //==============================================================================
-
- //------------------------------------------------------------------------------
- // Method: UndoAction
- // Origin: ODPart
- //
- // Description: This method is called when and action needs to be undone.
- //------------------------------------------------------------------------------
-
- void Cappuccino::UndoAction( Environment* ev,
- ODActionData* actionState )
- {
- SOM_Trace("Cappuccino","UndoAction");
-
- CAction::GetActionStateAction(actionState)->HandleUndo(ev);
- }
-
- //------------------------------------------------------------------------------
- // Method: RedoAction
- // Origin: ODPart
- //
- // Description: This method is called when an action needs to be redone.
- //------------------------------------------------------------------------------
-
- void Cappuccino::RedoAction( Environment* ev,
- ODActionData* actionState )
- {
- SOM_Trace("Cappuccino","RedoAction");
-
- CAction::GetActionStateAction(actionState)->HandleRedo(ev);
- }
-
- //------------------------------------------------------------------------------
- // Method: DisposeActionState
- // Origin: ODPart
- //
- // Description: This method is called when we need to dispose of the contents
- // of an ODActionData byte array because the action is not longer
- // needed by OpenDoc.
- //------------------------------------------------------------------------------
-
- void Cappuccino::DisposeActionState( Environment* ev,
- ODActionData* actionState,
- ODDoneState doneState)
- {
- SOM_Trace("Cappuccino","DisposeActionState");
-
- delete CAction::GetActionStateAction(actionState);
- }
-
-